<!DOCTYPE html>
<html lang="en">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>${_title}</title>

    <!-- Bootstrap core CSS -->

    <link href="${_css}/bootstrap.min.css" rel="stylesheet">

    <link href="${_font}/css/font-awesome.min.css" rel="stylesheet">
    <link href="${_css}/animate.min.css" rel="stylesheet">

    <!-- Custom styling plus plugins -->
    <link href="${_css}/custom.css" rel="stylesheet">
    <link href="${_css}/icheck/flat/green.css" rel="stylesheet">

    <!-- switchery -->
    <link rel="stylesheet" href="${_css}/switchery/switchery.min.css" />

    <script src="${_js}/jquery.min.js"></script>
    <script src="${_js}/resize.js"></script>

    <!--[if lt IE 9]>
        <script src="../assets/js/ie8-responsive-file-warning.js"></script>
        <![endif]-->

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
          <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
          <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
        <![endif]-->
</head>

<body style="background: #F7F7F7;" class="nav-md">
	<div class="">
        <div class="row" id="main-row">
            <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
                    <div class="x_title">
                        <h2>平台参数设置</h2>
                        <div class="clearfix"></div>
                    </div>
                    <div class="x_content">
                        <form class="form-horizontal">
                            <div class="item form-group">
                                <label class="control-label col-md-3 col-sm-3 col-xs-6" for="password">*注册赠送金额(元)
                                </label>
                                <div class="col-md-3 col-sm-3 col-xs-6">
                                	<input type="hidden" id="itemId" value="<#if config??>${config.id!}</#if>" class="form-control col-md-7 col-xs-12">
                                	
                                	<input type="number" id="regReward" value="<#if config??>${config.regReward!}</#if>" class="form-control col-md-7 col-xs-12">
                                </div>
                            </div>                         
                            <div class="item form-group">
                                <label class="control-label col-md-3 col-sm-3 col-xs-12" for="re-password">*提现手续费(笔)
                                </label>
                                <div class="col-md-3 col-sm-3 col-xs-6">
                                   <input type="number" id="withdrawFee" value="<#if config??>${config.withdrawFee!}</#if>"  class="form-control col-md-7 col-xs-7">提现手续费设置为每笔多少钱
                                </div>
                            </div>   
                            <div class="item form-group">
                                <label class="control-label col-md-3 col-sm-3 col-xs-12" for="password">*逾期罚息
                                </label>
                                <div class="col-md-3 col-sm-3 col-xs-6">
                                	<input type="text" id="overdueFee" value="<#if config??>${config.overdueFee!}</#if>"  class="form-control col-md-7 col-xs-12">逾期还款设置的罚款利息
                                </div>
                            </div>  
                            <div class="item form-group">
                                <label class="control-label col-md-3 col-sm-3 col-xs-12" for="password">*app版本号
                                </label>
                                <div class="col-md-3 col-sm-3 col-xs-6">
                                	<input type="text" id="appVersion" value="<#if config??>${config.appVersion!}</#if>"  class="form-control col-md-7 col-xs-12">app版本升级时才需要更改
                                </div>
                            </div>                             
                            <!--
                            <div class="item form-group">
                                <label class="control-label col-md-3 col-sm-3 col-xs-12" for="password">*自动投标比率(%)
                                </label>
                                <div class="col-md-3 col-sm-3 col-xs-6">
                                	<input type="number" id="autoPrecent" value="<#if config??>${config.autoPrecent!}</#if>"  class="form-control col-md-7 col-xs-12">自动投标和外部投标的比率
                                </div>
                            </div>
                            -->                                                                                   
                                              
                        </form>
                    </div>
                </div>
            </div>
        </div>
        
        <div class="row" style="margin-bottom:50px">
        	<div class="ln_solid"></div>
                <div class="form-group">
                    <div class="col-md-6 col-md-offset-5">
                        <button type="button" onclick="javascript:history.go(0)" class="btn btn-primary">刷新页面</button>
                        &nbsp;&nbsp;&nbsp;&nbsp;
                        <button type="button" id="btn-submit" class="btn btn-success">确认修改</button>
                    </div>
    			</div>
        	</div>       
		</div>
	</div>

    <script src="${_js}/bootstrap.min.js"></script>
    <!-- bootstrap progress js -->
	<script src="${_js}/progressbar/bootstrap-progressbar.min.js" type="text/javascript"></script>
	<script src="${_js}/nicescroll/jquery.nicescroll.min.js" type="text/javascript"></script>
    
	<script src="${_js}/custom.js" type="text/javascript"></script>

	 <!-- PNotify -->
	<script src="${_js}/notify/pnotify.core.js" type="text/javascript"></script>
	<script src="${_js}/notify/pnotify.buttons.js" type="text/javascript"></script>
	<script src="${_js}/notify/pnotify.nonblock.js" type="text/javascript" ></script>   
    <script type="text/javascript">
		$("#btn-submit").click(function(){
			var id=$("#itemId").val();
			var regReward=$.trim($("#regReward").val());
			var invitReward=$.trim($("#invitReward").val());
			var tenderReward=$.trim($("#tenderReward").val());
			var rewardNumber=$.trim($("#rewardNumber").val());
			var withdrawFee=$.trim($("#withdrawFee").val());
			var overdueFee=$.trim($("#overdueFee").val());
			var autoPrecent=$.trim($("#autoPrecent").val());
			var rewardUse=$.trim($("#rewardUse").val());
			var appVersion=$.trim($("#appVersion").val());
			var denomination=$.trim($("#denomination").val());
			var sheets=$.trim($("#sheets").val());
			
			var item=JSON.stringify({
				id:id,
				regReward:regReward,
				invitReward:invitReward,
				tenderReward:tenderReward,
				rewardNumber:rewardNumber,
				withdrawFee:withdrawFee,
				overdueFee:overdueFee,
				autoPrecent:autoPrecent,
				rewardUse:rewardUse,
				appVersion:appVersion,
				denomination:denomination,
				sheets:sheets
			});

			$.ajaxSetup({
				headers: {'Content-Type': 'application/json;charset=UTF-8'}
			});
				
			$.ajax({
	        	type: 'post',
	        	dataType: 'JSON',
	        	async:'false',
	        	url: '/admin/system/config/save',
	        	data:item,
	        	success: function(result){
	        		if(result.code==-1){
	            		new PNotify({
			            	title: '操作提示',
			            	text: "修改成功",
			            	delay: 3e3,
			            	type: 'success'
			        	});	        			
	        		}else{
	            		new PNotify({
			            	title: '操作提示',
			            	text: "服务器异常",
			            	delay: 3e3,
			            	type: 'error'
			        	});	        			
	        		}
	        	}
            });
		})
   </script>
</body>
</html>